<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>课程查询系统</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Microsoft YaHei', sans-serif;
        }

        body {
            background-color: #f5f5f5;
            min-height: 100vh;
        }

        .header {
            background: linear-gradient(120deg, #3498db, #8e44ad);
            color: white;
            padding: 15px 30px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        }

        .header h1 {
            font-size: 24px;
        }

        .container {
            max-width: 1200px;
            margin: 30px auto;
            padding: 0 20px;
        }

        .card {
            background-color: white;
            border-radius: 10px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
            padding: 30px;
            margin-bottom: 30px;
        }

        .card-title {
            font-size: 20px;
            color: #333;
            margin-bottom: 20px;
            padding-bottom: 10px;
            border-bottom: 1px solid #eee;
        }

        .form-group {
            margin-bottom: 20px;
        }

        label {
            display: block;
            margin-bottom: 5px;
            color: #555;
            font-weight: bold;
        }

        input[type="text"],
        input[type="tel"],
        select {
            width: 100%;
            padding: 12px;
            border: 1px solid #ddd;
            border-radius: 5px;
            font-size: 16px;
            transition: border 0.3s;
        }

        input[type="text"]:focus,
        input[type="tel"]:focus,
        select:focus {
            border-color: #3498db;
            outline: none;
        }

        .btn {
            padding: 12px 20px;
            border: none;
            border-radius: 5px;
            color: white;
            font-size: 16px;
            font-weight: bold;
            cursor: pointer;
            transition: background-color 0.3s;
        }

        .primary-btn {
            background-color: #3498db;
        }

        .primary-btn:hover {
            background-color: #2980b9;
        }

        #result {
            margin-top: 20px;
        }

        table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 20px;
        }

        th, td {
            padding: 12px 15px;
            text-align: left;
            border-bottom: 1px solid #ddd;
        }

        th {
            background-color: #f9f9f9;
            font-weight: bold;
        }

        tr:hover {
            background-color: #f5f5f5;
        }
    </style>
</head>
<body>
<div class="header">
    <h1>课程查询系统</h1>
</div>

<div class="container">
    <div class="card">
        <h2 class="card-title">课程查询</h2>
        <form id="courseForm">
            <div class="form-group">
                <input type="text" id="courseid" name="courseid" placeholder="输入课程ID或'全部'">
                <button type="submit" class="btn primary-btn" style="margin-top: 10px;">查询</button>
            </div>
        </form>
        <div id="result"></div>
    </div>

    <div class="card">
        <h2 class="card-title">课程选择</h2>
        <form id="enrollmentForm" action="/Student" method="POST">
            <div class="form-group">
                <label for="studentId">学号</label>
                <input type="text" id="studentId" name="studentid" required>
            </div>
            <div class="form-group">
                <label for="studentName">姓名</label>
                <input type="text" id="studentName" name="studentname" required>
            </div>
            <div class="form-group">
                <label for="gender">性别</label>
                <select id="gender" name="studentsex" required>
                    <option value="">请选择</option>
                    <option value="男">男</option>
                    <option value="女">女</option>
                </select>
            </div>
            <div class="form-group">
                <label for="className">班级</label>
                <input type="text" id="className" name="clas" required>
            </div>
            <div class="form-group">
                <label for="contactInfo">联系方式</label>
                <input type="tel" id="contactInfo" name="studentinformation" required>
            </div>
            <div class="form-group">
                <label for="courseCode">课程代码</label>
                <input type="text" id="courseCode" name="courseid" required>
            </div>
            <div class="form-group">
                <label for="courseName">课程名</label>
                <input type="text" id="courseName" name="coursename" required>
            </div>
            <button type="submit" class="btn primary-btn">提交选课</button>
        </form>
        <div id="enrollmentResult"></div>
    </div>
</div>
</body>
</html>